<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增收款账号')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: select2-css" />
    <th:block th:include="include :: bootstrap-fileinput-css" />
    <th:block th:include="include :: s2ztree-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-recipientInfo-add">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">归属码商：</label>
                <div class="col-sm-8">
<!--                    <input name="userId" class="form-control" type="text" required>-->
<!--                    <select name="userId" id="userId" class="form-control" required-->
<!--                            th:with="type=${@sysUser.selectUserListByType('ms')}">-->
<!--                        <option value="">所有</option>-->
<!--                        <option th:each="dict : ${type}" th:text="${dict.userName}"-->
<!--                                th:value="${dict.userId}"></option>-->
<!--                    </select>-->
<!--                    <input name="userName" id="userName"  class="form-control" type="text" placeholder="" readonly="readonly">-->
                    <select  name="userId" id="userId" class="form-control m-b"></select>

                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">通道类型：</label>
                <div class="col-sm-8">
                    <select name="channelType" id="channelType"  class="form-control m-b" th:with="type=${@dict.getType('channel_type')}" onchange="changeType()" required>
                        <option value="">所有</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">通道编码：</label>
                <div class="col-sm-8">
                    <select name="channel" id="channel"  class="form-control" onchange="changeChannel()" required>
                        <option value="">所有</option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">通道账号：</label>
                <div class="col-sm-8">
                    <input name="channelAccount" id="channelAccount"  class="form-control" type="text" placeholder="输入通道账号" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">账号别名：</label>
                <div class="col-sm-8">
                    <input name="realName" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">分组标签：</label>
                <div class="col-sm-8">
                    <input name="groupName" id="groupName" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否禁用：</label>
                <div class="col-sm-8">
                    <select name="channelDisabled"  class="form-control" th:with="type=${@dict.getType('yes_or_no')}" required>
                        <option value="">所有</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:selected="${dict.dictLabel} eq '否'" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">银卡ID：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="cardId" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">银行卡号：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="cardNo" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">支付宝cardid：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="alipayCardid" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">实名：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="realName" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">-->
<!--                <label class="col-sm-3 control-label">服务于指定用户：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <select name="serveMerId" id="serveMerId" class="form-control"-->
<!--                            th:with="type=${@sysUser.selectUserListByType('sh')}">-->
<!--                        <option value="0">所有</option>-->
<!--                        <option th:each="dict : ${type}" th:text="${dict.userName}"-->
<!--                                th:value="${dict.userId}"></option>-->
<!--                    </select>-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否可用：</label>
                <div class="col-sm-8">
                    <select name="available"  class="form-control" th:with="type=${@dict.getType('yes_or_no')}" required>
                        <option value="">所有</option>
                        <option th:each="dict : ${type}" th:selected="${dict.dictLabel} eq '是'" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>

            <div class="form-group" id="login_url_div" hidden="hidden">
                <label class="col-sm-3 control-label">登录网址</label>
                <div class="col-sm-8">
                    <input name="loginUrl" class="form-control" type="text" >
                </div>
            </div>
            <div class="form-group" hidden="hidden" id="passwd_div">
                <label class="col-sm-3 control-label is-required">登录密码：</label>
                <div class="col-sm-8">
                    <input name="passWord" class="form-control" type="text" >
                </div>
            </div>
            <div class="form-group" hidden="hidden" id="ck_div">
                <label class="col-sm-3 control-label is-required">登录CK：</label>
                <div class="col-sm-8">
                    <textarea name="loginCk" class="form-control" rows="3"></textarea>
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label is-required">是否需要客户端在线：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="needOnline" class="form-control" type="text" required>-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group" hidden="hidden" id="lkl_shop_name_div">
                <label class="col-sm-3 control-label is-required">店铺名：</label>
                <div class="col-sm-8">
                    <input name="lklShopname" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group" hidden="hidden" id="lkl_shop_no_div">
                <label class="col-sm-3 control-label is-required">商户号：</label>
                <div class="col-sm-8">
                    <input name="lklShopno" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group" hidden="hidden" id="lkl_shop_tremno_div">
                <label class="col-sm-3 control-label is-required">终端号：</label>
                <div class="col-sm-8">
                    <input name="lklTermno" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group" hidden="hidden" id="req_div">
                <label class="col-sm-3 control-label">请求参数：</label>
                <div class="col-sm-8">
                    <textarea name="accountJson" class="form-control" rows="5"></textarea>
                </div>
            </div>
            <div class="form-group" hidden="hidden" id="rs_div">
                <label class="col-sm-3 control-label">返回参数：</label>
                <div class="col-sm-8">
                    <textarea name="returnJson" class="form-control" rows="5"></textarea>
                </div>
            </div>
            <div class="form-group" hidden="hidden" >
                <label class="col-sm-3 control-label">收款二维码：</label>
                <div class="col-sm-8">
                    <textarea name="receiptQrcode" class="form-control"></textarea>
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">手机序列号imei：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="imei" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">设备信息：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="deviceInfo" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">每日限额：</label>
                <div class="col-sm-8">
                    <input name="limitDayMoney" class="form-control" value="0" placeholder="0为不限制" type="text" required>
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label is-required">今天已收金额：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="todayMoney" class="form-control" type="text" required>-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">总限额：</label>
                <div class="col-sm-8">
                    <input name="limitMaxMoney" class="form-control" value="0" placeholder="0为不限制" type="text" required>
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label is-required">总收取金额：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="totalMoney" class="form-control" type="text" required>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label is-required">是否店长模式：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="shopManager" class="form-control" type="text" required>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">店长昵称：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="shopNickname" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">店员的账号：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="shopClerkAccount" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">店员监控客户端是否在线：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="shopClerkOnline" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">总的成功收款笔数：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="totalCount" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">限制最多笔数：</label>
                <div class="col-sm-8">
                    <input name="limitMaxCount" class="form-control" value="0" placeholder="0为不限制" type="text" required>
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">今日成功收款笔数：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="todayCount" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">今日限制笔数：</label>
                <div class="col-sm-8">
                    <input name="limitDayCount" class="form-control" value="0" placeholder="0为不限制" type="text" required>
                </div>
            </div>
            <div class="form-group" hidden="hidden" >
                <label class="col-sm-3 control-label">二维码金额：</label>
                <div class="col-sm-8">
                    <input name="supportAmount" class="form-control" type="text">
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">PAYJS秘钥：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="payJsKey" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">最后产码时间：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <div class="input-group date">-->
<!--                        <input name="lastCreateBillTime" class="form-control" placeholder="yyyy-MM-dd" type="text">-->
<!--                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">身份证姓名：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="idCardName" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">身份证号码：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="idCardNo" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">手机号码：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="phoneNo" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">京东买手号：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="jdBuyerId" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">-->
<!--                <label class="col-sm-3 control-label">思语cookie：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <textarea name="cookie" class="form-control"></textarea>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">今日临时总收款：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="todayTmpMoney" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">京东电费缴费城市：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="jdDfCityId" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">电费缴费单位：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="jdDfUnitId" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">电费余额：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="jdDfBlance" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">单笔限额：</label>
                <div class="col-sm-8">
                    <input name="onecePayLimit" class="form-control" value="0" placeholder="0为不限制" type="text" required>
                </div>
            </div>
            <div  hidden="hidden" id="area_div">
                <div class="form-group" >
                    <label class="col-sm-3 control-label">归属省份：</label>
                    <div class="col-sm-8">
    <!--                    <input name="province" class="form-control" type="text">-->
                        <select name="province" id="province" class="form-control" onchange="changePro()"
                                th:with="type=${@proxyAreaCodeService.selectProvineCodeList()}">
                            <option value="">所有</option>
                            <option th:each="dict : ${type}" th:text="${dict.province}"
                                    th:value="${dict.provinceCode}"></option>
                        </select>
                    </div>
                </div>
                <div class="form-group" >
                    <label class="col-sm-3 control-label">归属城市：</label>
                    <div class="col-sm-8">
    <!--                    <input name="city" class="form-control" type="text">-->
                        <select name="city" id="city"  class="form-control">
                            <option value="">所有</option>
                        </select>
                    </div>
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="bankName" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">-->
<!--                <label class="col-sm-3 control-label">：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <textarea name="disabledInfo" class="form-control"></textarea>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="createUser" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="updateUser" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="weiShu" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
            <div hidden="hidden" id="alipay_isv_div">

                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">服务商：</label>
                    <div class="col-sm-8">
                        <select name="isvId" id="isvId" class="form-control"
                                th:with="type=${@isvInfo.selectTIsvInfoListByType(0)}">
                            <option value="">所有</option>
                            <option th:each="dict : ${type}" th:text="${dict.isvName}"
                                    th:value="${dict.id}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div hidden="hidden" id="alipay_div">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">支付宝公钥：</label>
                    <div class="col-sm-8">
                        <textarea name="aliPublicKey" class="form-control"></textarea>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">应用私钥：</label>
                    <div class="col-sm-8">
                        <textarea name="aliPrivateKey" class="form-control"></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required"></label>
                    <div class="col-sm-8">
                        <span class="help-block m-b-none"><i class="fa fa-info-circle"></i><a href="https://opendocs.alipay.com/support/01raut?pathHash=2c7adc9e" target="_blank">获取支付宝公钥和应用私钥</a> </span>
                    </div>
                </div>
            </div>

            <div hidden="hidden" id="gamepay_div">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">网关地址：</label>
                    <div class="col-sm-8">
                        <input name="gameUrl" class="form-control"></input>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">商户号：</label>
                    <div class="col-sm-8">
                        <input name="gamePid" class="form-control"></input>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">密钥：</label>
                    <div class="col-sm-8">
                        <input name="gameKey" class="form-control"></input>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">支付类型：</label>
                    <div class="col-sm-8">
                        <input name="gamepayType" class="form-control"></input>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">支付方式：</label>
                    <div class="col-sm-8">
                        <input name="gamepayMethod" class="form-control"></input>
                    </div>
                </div>
            </div>
            <div hidden="hidden" id="yunyinqianpay_div">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">登录CK：</label>
                    <div class="col-sm-8">
                        <input name="yyqCk" class="form-control"></input>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">商户号：</label>
                    <div class="col-sm-8">
                        <input name="yyqUserId" class="form-control"></input>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">说明：</label>
                    <div class="col-sm-8">
                        <input name="yyqOrderSubject" class="form-control"></input>
                    </div>
                </div>
            </div>
            <div hidden="hidden" id="alipay_cert_div">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">应用公钥证书：</label>
                    <div class="col-sm-8">
                        <input id="certAppPublicKeyFile" name="file" type="file">
                        <input id="certAppPublicPath" name="certAppPublicPath" type="hidden">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">支付宝公钥证书：</label>
                    <div class="col-sm-8">
                        <input id="certAliPublicKeyFile" name="file" type="file">
                        <input id="certAliPublicPath" name="certAliPublicPath" type="hidden">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">支付宝根证书：</label>
                    <div class="col-sm-8">
                        <input id="certAliRootKeyFile" name="file" type="file">
                        <input id="certAliRootPath" name="certAliRootPath" type="hidden">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">商户私钥：</label>
                    <div class="col-sm-8">
                        <textarea name="certAliPrivateKey" class="form-control"></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required"></label>
                    <div class="col-sm-8">
                        <span class="help-block m-b-none"><i class="fa fa-info-circle"></i><a href="https://opendocs.alipay.com/support/01rauw?pathHash=452a35f8" target="_blank">获取证书和应用私钥</a> </span>
                    </div>
                </div>

            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: select2-js" />
    <th:block th:include="include :: bootstrap-fileinput-js" />
    <th:block th:include="include :: s2ztree-js" />
    <th:block th:include="include :: bootstrap-typeahead-js" />

    <script th:inline="javascript">
        var prefix = ctx + "business/recipientInfo"
        var userTreeurl = ctx + "system/user/userTreeData" ;
        var setting = {
            view : {
                dblClickExpand : false
            },
            data : {
                simpleData : {
                    enable : true
                }
            }
        };
        $("#form-recipientInfo-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-recipientInfo-add').serialize());
            }
        }

        // $("input[name='lastHeartbeat']").datetimepicker({
        //     format: "yyyy-mm-dd",
        //     minView: "month",
        //     autoclose: true
        // });
        //
        // $("input[name='lastCreateBillTime']").datetimepicker({
        //     format: "yyyy-mm-dd",
        //     minView: "month",
        //     autoclose: true
        // });
        function changeType(){
            if($("#channelType").val()==""){
                return;
            }
            requrl=ctx+"business/channel/getChannel/"+$("#channelType").val();
            var config = {
                url:requrl ,
                type: "post",
                dataType: "json",
                beforeSend: function () {
                    $.modal.loading("正在处理中，请稍后...");
                    // $.modal.disable();
                },
                success: function(result) {
                    $.modal.closeLoading();
                    if (result.code == web_status.SUCCESS) {
                        $("#channel").html("<option value=\"\">所有</option>");
                        $.each(result.data, function(key, val) {
                            var option1 = $("<option>").val(val.channel).text(val.channelDesc);
                            $("#channel").append(option1);
                            // form.render('select');
                        });
                    }else{
                        $.modal.alertError(result.msg);
                    }
                }
            };
            $.ajax(config)
        }

        function changeChannel() {
            var channel = $("#channel").val();
            if(channel==""){
                return;
            }
            if(channel.startsWith("isv_alipay")){
                $("#alipay_isv_div").show();
            }else{
                $("#alipay_isv_div").hide();
            }
            if(channel.startsWith("gf_alipay_")){
                $("#alipay_div").show();
            }else{
                $("#alipay_div").hide();
            }
            if(channel.startsWith("gf_cert_alipay_")){
                $("#alipay_cert_div").show();
            }else{
                $("#alipay_cert_div").hide();
            }
            if(channel.startsWith("lakala_pay")){
                $("#lkl_shop_no_div").show();
                $("#lkl_shop_name_div").show();
                $("#lkl_shop_tremno_div").show();

            }else{
                $("#lkl_shop_no_div").hide();
                $("#lkl_shop_name_div").hide();
                $("#lkl_shop_tremno_div").hide();
            }
            if(channel.startsWith("game_pay_")){
                $("#gamepay_div").show();
            }else{
                $("#gamepay_div").hide();
            }

            if(channel.startsWith("yunyinqian_pay_")){
                $("#yunyinqianpay_div").show();
            }else{
                $("#yunyinqianpay_div").hide();
            }

            requrl=ctx+"business/channel/getChannelByCode/"+$("#channel").val();
            var config = {
                url:requrl ,
                type: "post",
                dataType: "json",
                beforeSend: function () {
                    $.modal.loading("正在处理中，请稍后...");
                    // $.modal.disable();
                },
                success: function(result) {
                    $.modal.closeLoading();
                    if (result.code == web_status.SUCCESS) {
                        var obj = result.data;
                        if(obj.reqType==0){
                            $("#req_div").show();
                            $("#rs_div").show();
                        }else{
                            $("#req_div").hide();
                            $("#rs_div").hide();
                            if(obj.needOnLine==1 && obj.loginType=='passwd'){
                                // $("#login_url_div").show();
                                $("#passwd_div").show();
                            }else if(obj.needOnLine==1 && obj.loginType=='ck'){
                                $("#login_url_div").hide();
                                $("#passwd_div").hide();
                                $("#ck_div").show();
                            }else {
                                $("#login_url_div").hide();
                                $("#passwd_div").hide();
                                $("#ck_div").hide();
                            }
                            if(obj.isArea==1){
                                $("#area_div").show();
                            }else{
                                $("#area_div").hide();
                            }
                        }
                    }else{
                        $.modal.alertError(result.msg);
                    }
                }
            };
            $.ajax(config)
        }
        $(document).ready(function () {
            getUserSelectTree();
            // 单图上传
            $("#certAppPublicKeyFile").fileinput({
                uploadUrl: ctx + "common/aliupload/"+[[${fileid}]],
                maxFileCount: 1,
                autoReplace: true,
                showPreview: false,
                dropZoneEnabled: false,
                msgPlaceholder: "请选择appCertPublicKey开头的文件"
            }).on('fileuploaded', function (event, data, previewId, index) {
                var rsp = data.response;
                $("#certAppPublicPath").val(rsp.fileName);
                log.info("return url：" + rsp.url)
                log.info("reutrn fileName：" + rsp.fileName)
                log.info("reutrn newFileName：" + rsp.newFileName)
                log.info("return originalFilename：" + rsp.originalFilename)
            }).on('fileremoved', function (event, id, index) {
                $("input[name='" + event.currentTarget.id + "']").val('')
            })

            $("#certAliPublicKeyFile").fileinput({
                uploadUrl: ctx + "common/aliupload/"+[[${fileid}]],
                maxFileCount: 1,
                autoReplace: true,
                showPreview: false,
                dropZoneEnabled: false,
                msgPlaceholder: "请选择alipayCertPublicKey开头的文件"
            }).on('fileuploaded', function (event, data, previewId, index) {
                var rsp = data.response;
                $("#certAliPublicPath").val(rsp.fileName);

                log.info("return url：" + rsp.url)
                log.info("reutrn fileName：" + rsp.fileName)
                log.info("reutrn newFileName：" + rsp.newFileName)
                log.info("return originalFilename：" + rsp.originalFilename)
            }).on('fileremoved', function (event, id, index) {
                $("input[name='" + event.currentTarget.id + "']").val('')
            })

            $("#certAliRootKeyFile").fileinput({
                uploadUrl: ctx + "common/aliupload/"+[[${fileid}]],
                maxFileCount: 1,
                autoReplace: true,
                showPreview: false,
                dropZoneEnabled: false,
                msgPlaceholder: "请选择alipayRootCert开头的文件"
            }).on('fileuploaded', function (event, data, previewId, index) {
                var rsp = data.response;
                $("#certAliRootPath").val(rsp.fileName);
                log.info("return url：" + rsp.url)
                log.info("reutrn fileName：" + rsp.fileName)
                log.info("reutrn newFileName：" + rsp.newFileName)
                log.info("return originalFilename：" + rsp.originalFilename)
            }).on('fileremoved', function (event, id, index) {
                $("input[name='" + event.currentTarget.id + "']").val('')
            })

        });

        $.get(prefix + "/getGroupName", function(data){
            $("#groupName").typeahead({
                source: data.value
            });
        },'json');
        function changePro() {
            if($("#province").val()==""){
                return;
            }
            requrl=ctx+"business/ProxyAreaCode/getCityByCode/"+$("#province").val();
            var config = {
                url:requrl ,
                type: "post",
                dataType: "json",
                beforeSend: function () {
                    $.modal.loading("正在处理中，请稍后...");
                    // $.modal.disable();
                },
                success: function(result) {
                    $.modal.closeLoading();
                    if (result.code == web_status.SUCCESS) {
                        $("#city").html("<option value=\"\">所有</option>");
                        $.each(result.data, function(key, val) {
                            var option1 = $("<option>").val(val.cityCode).text(val.city);
                            $("#city").append(option1);
                            // form.render('select');
                        });
                    }else{
                        $.modal.alertError(result.msg);
                    }
                }
            };
            $.ajax(config)
        }


        function getUserSelectTree() {
            //查询条件
            var params = {
                merchantType: "ms"
            };
            var config = {
                url:userTreeurl ,
                type: "post",
                dataType: "json",
                data: params,
                beforeSend: function () {
                    $.modal.loading("正在处理中，请稍后...");
                    // $.modal.disable();
                },
                success: function(result) {
                    $.modal.closeLoading();
                    $('select[name=userId]').select2ztree({
                        textField : 'name',
                        titleField : 'name',
                        ztree : {
                            setting : $.extend(true, {
                                treeId : 'userId'
                            }, setting),
                            zNodes : result
                        }
                    });

                }
            };
            $.ajax(config)
        }


    </script>
</body>
</html>